@import '~@alife/aone-core/variables/index.scss';
@import '~@alife/at-theme/teambition/scss/index.scss';

.w300 {
  width: 300px;
  background-color: blue;
}

.project-content-body {
  padding-bottom: 20px;
}

.project-nav {
  min-height: 100%;
  display: flex;
  flex-direction: column;

  &-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 24px 15px 0 9px;

    &-search-input {
      width: 200px;
      margin-right: 12px;
      margin-left: 6px;
    }

    &-right {
      & > * {
        margin-left: 8px;
      }
    }
  }

  &-tree {
    // flex: 1 1;
    padding: 20px 12px 20px 12px;
    overflow-x: auto;
    overflow-y: auto;
    height: calc(100% - 145px);

    .#{$teamix-prefix}tree-node {
      position: relative;

      // &-label {
      //   background-color: transparent !important;
      // }
      &-inner {
        border-radius: 4px;

        &:hover {
          background-color: #f7f7f7 !important;
        }
      }

      &-label {
        background-color: transparent !important;
      }

      .#{$teamix-prefix}selected {
        background-color: #f0f9ff !important;
        .#{$teamix-prefix}tree-node-label-wrapper {
          background-color: #f0f9ff !important;
        }
      }
    }

    .label-content {
      position: relative;
      display: inline-block;
      width: 100%;

      .#{$teamix-prefix}menu {
        position: absolute;
      }

      i,
      .name {
        display: inline-block;
        vertical-align: middle;
      }

      .add-upload-file-btn {
        position: absolute;
        right: 34px;
        height: 30px;
        top: -1px;
        display: none;

        .#{$teamix-prefix}overlay-inner {
          left: -76px !important;
        }
      }
    }

    .tree-class {
      .label-content:hover {
        padding-right: 50px;

        .add-upload-file-btn {
          display: inline-block;
          vertical-align: middle;

          &:hover i {
            color: $primary-brand;
          }
        }
      }
    }
  }
}

.project-file-wrapper {
  .teamix-layout-body-content {
    padding-top: 0 !important;
  }

  .teamix-layout-content {
    padding-top: var(--layout-padding-top-and-bottom, 16px);
  }

  // flex: 1;
  // min-width: 980px;
  // box-sizing: border-box;
  // display: flex;
  // flex-direction: row;
  // min-height: 100%;
  .project-content {
    padding-top: 0 !important;
  }

  // hack源文件Content的横向滚动条
  .project-file-layout-content {
    padding-right: 0 !important;
    padding-left: 0 !important;
  }

  .project-file-content {
    min-width: 680px;
    padding-left: 40px;
    padding-right: 40px;

    // flex: 1;
    // overflow-y: auto;
    // position: relative;
    // max-width: 1200px;
    // padding: 0 16px;
    // margin: 0 auto;
    &-title {
      height: 76px;
      background: #fff;
    }

    &-body {
      // background: #fff;
      tr {
        cursor: pointer;
      }

      .project-content-des {
        background: rgba(78, 192, 99, 0.1);
        border-radius: 4px;
        text-align: left;
        font-size: 14px;
        color: #383838;
      }

      .project-content-filename {
        height: 54px;
        line-height: 54px;
      }

      .project-content-blob {
        margin-bottom: 16px;
      }

      .file-box-header-detail {
        display: flex;
        justify-content: space-between;
        align-items: center;

        &-right {
          display: flex;
          align-items: center;

          & > span {
            height: 24px;
          }
        }
      }

      .not-previewable {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 40px;

        .text {
          margin-top: 30px;
          text-align: left;
          line-height: 20px;
          font-size: 14px;
          color: #808080;
          margin-bottom: 20px;
        }
      }
    }
  }
}

.project-nav-tree {
  // 目录层级向左缩小一点，原先24px
  .#{$teamix-prefix}tree.#{$teamix-prefix}node-indent
  .#{$teamix-prefix}tree-node
  .#{$teamix-prefix}tree-node {
    margin-left: 14px;
  }

  // 三角箭头右边部分元素，取消左边padding
  .#{$teamix-prefix}tree-node-label {
    padding-left: 0;
  }
}

.project-nav-tree .file-tree {
  // width: 100%;

  span.#{$teamix-prefix}tree-switcher {
    position: absolute;
    // 三角箭头的间距
    padding-left: 8px;
    margin-right: 0px;
    width: 24px !important;
    height: 28px !important;
    line-height: 28px !important;
    // 让三角箭头居左，取消居中
    // text-align: center;
  }

  .#{$teamix-prefix}tree-node-inner > span {
    flex: none;
  }

  .#{$teamix-prefix}tree-node-inner > div {
    flex: 1;

    // overflow: hidden;
    .label-content {
      display: flex;

      .file-icon {
        width: 20px;
        height: 20px;
        flex: none;
        margin-right: 4px;
      }

      .one-line-ellipsis {
        // overflow: hidden;
        color: #6e6e6e !important;
      }
    }
  }

  .#{$teamix-prefix}tree-node-label-wrapper {
    margin-left: 28px;
  }

  .#{$teamix-prefix}tree-node-label > span {
    color: #6e6e6e !important;
  }
}

/** 仓库不存在卡片样式 */
.not-exist-card {
  margin-top: 100px;

  &-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100px;
  }
}

.not-auth-wrapper {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: #f5f5f5;

  .not-auth-content {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
  }
}

// 左侧没树结构时
.left-tree-empty {
  margin-top: 180px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.empty-desc {
  display: flex;
  align-items: center;

  &-btn {
    margin: 0 4px;
  }
}

.cmd-title {
  text-align: left;
  line-height: 24px;
  font-size: 16px;
  color: #383838;
  padding: 20px 0;
  margin: 0;
  border-bottom: 1px solid $color-line-2;

  &:last-child {
    border-bottom: 0;
    padding: 10px 0 0;
  }
}

.blob-loading-wrapper {
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
}

// 上传文件input框
.upload-file {
  height: 36px;
  line-height: 36px;
  text-align: center;
  border: 1px dashed $primary-brand;
  color: $primary-brand;
  border-radius: 4px;
  margin-bottom: 8px;
  cursor: pointer;

  &:hover {
    background: $gray-03;
  }
}

// 文件检索
.filter-no-data {
  min-height: 250px;
  height: calc(100vh - 190px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.filter-loading-data {
  margin-top: 85px;
  text-align: center;
}

.file-name-col > div {
  max-width: 480px;

  .lfs {
    max-width: calc(100% - 43px);
  }
}
.file-last-commit-col > div {
  max-width: 700px;
}

.updatetime-col > div {
  width: 144px;
}

.file-commit-container {
  margin-top: 8px;
  margin-bottom: 20px;
  min-height: 68px; // 高度占位，因为骨架屏现在不是直接出的了，需要这个占位

  .yx-list-item-content {
    max-width: calc(100% - 192px);
    margin: 4px 0;
    overflow: hidden;

    .yx-list-item-title {
      width: 100%;
    }

    .commit-msg-title {
      a {
        max-width: calc(100% - 111px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
  }
}

.project-new-files {
  &-form {
    display: inline-block;

    .#{$teamix-prefix}form-item-help {
      display: inline-block;
      margin-left: 12px;
      position: relative;
    }
  }

  &-input {
    margin: 0;
    padding: 0;
  }

  .file-panel-normal.file-panel-src {
    border: 0;

    .file-panel-src-header {
      background: #fff;
      padding: 16px 0;
      border-bottom: 0;
      font-weight: normal;
    }
  }

  .file-cancle-confirm {
    .next-message-symbol-icon {
      color: #da8506 !important;

      &:before {
        font-size: 20px !important;
        width: 20px !important;
      }
    }

    .next-message-title {
      font-size: 14px !important;
    }
  }

  .file-save-dialog-input {
    width: 560px;
  }
}

// TODO 按视觉稿 hack AT的样式，待AT修复
.file-table {
  border: 1px solid $gray-02 !important;
  border-radius: 4px;
  box-shadow: none;

  th {
    background: $gray-01;
    font-size: 14px;
  }

  th,
  td {
    border-color: $gray-02;
  }

  .#{$teamix-prefix}table-row {
    cursor: pointer;

    &:last-child {
      td {
        border-bottom: 0;
      }
    }
  }

  &-secondary-col {
    color: $gray-06;
  }
}

.file-icon {
  color: $gray-06;
}

.project-file-content-blob {
  margin-bottom: 20px;
}

.table-cell-inline-block {
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
}

// 上传路径
.upload-path {
  color: $gray-08;
  line-height: 20px;
  font-size: 14px;
  margin-bottom: 12px;
}

// 上传提示
.upload-file-path-help {
  line-height: 20px;
  font-size: 12px;
  color: $gray-06;
}

// 防止高亮遮挡行号
#highlighter-blob-content pre {
  & > code {
    z-index: 1;

    &:first-child {
      position: relative;
      z-index: 2;
    }
  }
}
